<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

namespace Controller;

/**
 *  Close 离线处理
 *
 * @author dongasai
 */
class Close
{

    /**
     * 当用户断开连接时触发
     * @param int $client_id 连接id
     * @version -1
     */
    public static function onClose($client_id)
    {
        echo 'onClose for ' . $client_id . ' ' . time() . "\n";
        if (!empty($_SESSION['room_id'])) {

            self::roomup($_SESSION['room_id'], $client_id);
        }
    }

}
